const { defineConfig } = require('@vue/cli-service')
const url ='10.108.7.180:8080'
module.exports = defineConfig({
  transpileDependencies: true,

  devServer: {
  // 配置跨域

  
    proxy: {
      '/api': {
        target: 'http://'+url,
        ws: false,
        changOrigin: true,  // 允许跨域
        pathRewrite: {
          '^/api': ''
        }
      },
      '/socket': {
        target: 'ws://'+url,//后端目标接口地址
        changeOrigin: true,//是否允许跨域
        pathRewrite: {
          '^/socket': '',//重写,
        },
        ws: true //开启ws, 如果是http代理此处可以不用设置
      }
    },
  }
})
